for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
function post_done(jqXHR)
{
if(jqXHR.status === 200)
alert('Success!');
location = 'index.php';
}
else
alert('Error! '+jqXHR.responseText);
function submit_page(e)
e
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.
var obj = {};
obj.name = $('#name').val();
if(obj.name.length === 0)
$('#name').parent().addClass('has-error')
return;
$('#name').parent().removeClass('has-error')
if($('#presenting:checked').length > 0)
obj.presenting = true;
obj.presenting = false;
$.ajax({
url: 'api/v1/themes',
type: 'post',
dataType: 'json',
data: JSON.stringify(obj),
processData: false,
complete: post_done
});
function init_page()
$('[name=submit]').on('click', submit_page);
$(init_page);
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.